<?php

/**
 * Web模块路由
 */

// Auth
Route::get('login', 'Auth\LoginController@showLoginForm');
Route::post('login', 'Auth\LoginController@login');
Route::get('logout', 'Auth\LoginController@logout');
Route::get('register', 'Auth\RegisterController@showRegistrationForm');
Route::post('register', 'Auth\RegisterController@register');
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
Route::get('password/reset/{token?}', 'Auth\ResetPasswordController@showResetForm');
Route::post('password/reset', 'Auth\ResetPasswordController@reset');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');

Route::get('/', 'HomeController@index');
Route::get('email/verify/{token}', ['as' => 'email.verify', 'uses' => 'HomeController@verifyEmail']);
Route::get('/get-category', 'HomeController@getCategoryByPid');
Route::post('/upload', 'UploadController@upImg');

Route::group([
    'prefix'        => 'user',
    'middleware'    => 'auth',
], function (){
    Route::get('/new-topic', 'UserController@newTopic');
});